<?php

namespace App\Admin\Actions\Chapter;

use App\Admin\Forms\ImportPlayerForm;
use Dcat\Admin\Grid\RowAction;
use Dcat\Admin\Widgets\Modal;
use Throwable;

class ImportPlayer extends RowAction
{
    protected string $title = '批量导入选手';

    /**
     * @throws Throwable
     */
    public function render(): string
    {
        return Modal::make()
            ->lg()
            ->title($this->title)
            ->body(ImportPlayerForm::make()->payload(['chapter_id' => $this->getKey()]))
            ->button($this->title)
            ->render();
    }
}
